
R version 4.1.2 (2021-11-01) -- "Bird Hippie"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin17.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

[Previously saved workspace restored]

> # Regression tables in Appendix for JOP
> # Last updated April 13 2022
> library(tidyverse)
── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ──
✔ ggplot2 3.3.5     ✔ purrr   0.3.4
✔ tibble  3.1.6     ✔ dplyr   1.0.7
✔ tidyr   1.1.4     ✔ stringr 1.4.0
✔ readr   2.1.0     ✔ forcats 0.5.1
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
> library(texreg)
Version:  1.37.5
Date:     2020-06-17
Author:   Philip Leifeld (University of Essex)

Consider submitting praise using the praise or praise_interactive functions.
Please cite the JSS article in your publications -- see citation("texreg").

Attaching package: ‘texreg’

The following object is masked from ‘package:tidyr’:

    extract

> library(fixest)
(Permanently remove the following message with fixest_startup_msg(FALSE).)
fixest 0.10.0:
- vcov: new argument 'vcov' that replaces 'se' and 'cluster' in all functions
(retro compatibility is ensured).
- function 'dof()' has been renamed into 'ssc()' (i.e. small sample correction).
From fixest 0.9.0 onward: BREAKING changes! 
- In i():
    + the first two arguments have been swapped! Now it's i(factor_var,
continuous_var) for interactions.
    + argument 'drop' has been removed (put everything in 'ref' now).
- In feglm(): 
    + the default family becomes 'gaussian' to be in line with glm(). Hence, for
Poisson estimations, please use fepois() instead.
> library(sandwich)
> library(lubridate)

Attaching package: ‘lubridate’

The following objects are masked from ‘package:base’:

    date, intersect, setdiff, union

> library(lfe)
Loading required package: Matrix

Attaching package: ‘Matrix’

The following objects are masked from ‘package:tidyr’:

    expand, pack, unpack

> library(here)
here() starts at /Users/elisha/Dropbox/current-research/Glynn - Race and Policing/Papers/Published Papers/JOP_RacialBias
> 
> ### load data -------
> load(here('data','ois_data_for_models.RData'))
> cluster_variable <- "new_group_id"
> orig$year_factor <- factor(orig$year)
> # Table 6 adding year fixed effects Logistic Appendix -----
> glm_main1 <- feglm(fatal~Black + Hispanic + Asian +trauma10 +
+                      city_clean, 
+                    data=orig,
+                    family=binomial(link="logit"),
+                    se="cluster",
+                    cluster=cluster_variable)
NOTE: 24 observations removed because of NA values (RHS: 24).
> 
> glm_main2 <- feglm(fatal~Black + Hispanic + Asian + trauma10 +
+                      year_factor, 
+                    data=orig,
+                    family=binomial(link="logit"),
+                    se="cluster",
+                    cluster=cluster_variable)
NOTE: 24 observations removed because of NA values (RHS: 24).
> 
> glm_main3 <- feglm(fatal~Black + Hispanic + Asian + trauma10 +
+                      city_clean + year_factor,
+                    data=orig,
+                    family=binomial(link="logit"),
+                    se="cluster",
+                    cluster=cluster_variable)
NOTE: 24 observations removed because of NA values (RHS: 24).
> 
> 
> glm_main4 <- feglm(fatal~Black + Hispanic + Asian + trauma10 +
+                      city_clean*year_factor,
+                    data=orig,
+                    family=binomial(link="logit"),
+                    se="cluster",
+                    cluster=cluster_variable)
NOTE: 24 observations removed because of NA values (RHS: 24).
Variables 'city_cleanSeattle:year_factor2016', 'city_cleanKing County:year_factor2017' and 'city_cleanSan Jose:year_factor2017' have been removed because of collinearity (see $collin.var).
> 
> # name mapping list
> coefsnames <- list('Black' = 'Black',
+                    "Hispanic" = 'Hispanic',
+                    'Asian' = 'Asian/AI/AN/PI',
+                    'trauma10' = 'Closest Trauma (10s miles)',
+                    'city_cleanHouston' = 'Houston',
+                    'city_cleanKing County' = 'King County',
+                    'city_cleanLos Angeles' = 'Los Angeles',
+                    'city_cleanOrlando' = 'Orlando',
+                    'city_cleanSan Jose' = 'San Jose',
+                    'city_cleanSeattle' = 'Seattle',
+                    'city_cleanTucson' = 'Tucson',
+                    'year_factor2011' = '2011',
+                    'year_factor2012' = '2012',
+                    'year_factor2013' = '2013',
+                    'year_factor2014' = '2014',
+                    'year_factor2015' = '2015',
+                    'year_factor2016' = '2016',
+                    'year_factor2017' = '2017',
+                    '(Intercept)' = 'Intercept')
> 
> screenreg(list(glm_main1,glm_main2,glm_main3,glm_main4),
+           custom.coef.map = coefsnames,
+           omit.coef = ":",
+           include.dev = FALSE,
+           include.loglik = FALSE,
+           include.pseudors = FALSE)

=========================================================================
                            Model 1    Model 2     Model 3    Model 4    
-------------------------------------------------------------------------
Black                         -0.67 *    -0.82 **    -0.74 *    -0.77 *  
                              (0.33)     (0.31)      (0.33)     (0.35)   
Hispanic                       0.13       0.28        0.11       0.12    
                              (0.31)     (0.31)      (0.32)     (0.34)   
Asian/AI/AN/PI                 0.91       1.04        0.96       0.98    
                              (0.58)     (0.64)      (0.60)     (0.68)   
Closest Trauma (10s miles)     0.41       0.19        0.45 *     0.50 *  
                              (0.21)     (0.18)      (0.21)     (0.21)   
Houston                       -0.21                  -0.19      15.17 ***
                              (0.63)                 (0.59)     (0.64)   
King County                   -0.12                  -0.17      14.02 ***
                              (0.81)                 (0.79)     (1.89)   
Los Angeles                    1.15                   1.18 *    16.96 ***
                              (0.62)                 (0.58)     (0.48)   
Orlando                        0.52                   0.50      15.56 ***
                              (0.70)                 (0.67)     (0.83)   
San Jose                       0.16                   0.18      15.38 ***
                              (0.69)                 (0.67)     (1.22)   
Seattle                        1.27                   1.20      16.66 ***
                              (0.77)                 (0.76)     (0.93)   
Tucson                         1.64 *                 1.54 *    32.32 ***
                              (0.73)                 (0.69)     (0.67)   
2011                                      0.51        0.33       0.88 ** 
                                         (0.41)      (0.40)     (0.33)   
2012                                      0.25        0.33      33.51 ***
                                         (0.43)      (0.42)     (0.24)   
2013                                      0.34        0.30      16.43 ***
                                         (0.43)      (0.42)     (0.95)   
2014                                      0.63        0.63      15.24 ***
                                         (0.47)      (0.45)     (1.14)   
2015                                      0.20        0.27      17.38 ***
                                         (0.44)      (0.42)     (1.03)   
2016                                      0.13        0.28       1.29    
                                         (0.44)      (0.41)     (1.43)   
2017                                     -0.13       -0.09       1.29    
                                         (0.52)      (0.50)     (1.44)   
Intercept                     -1.00      -0.31       -1.27     -16.83 ***
                              (0.64)     (0.41)      (0.66)     (0.11)   
-------------------------------------------------------------------------
pseudo.r.squared               0.10       0.05        0.10       0.15    
nobs                        1250       1250        1250       1250       
AIC                         1586.54    1664.18     1590.08    1586.12    
BIC                         1648.11    1725.75     1687.56    1899.10    
Log Likelihood              -781.27    -820.09     -776.04    -732.06    
=========================================================================
*** p < 0.001; ** p < 0.01; * p < 0.05
Warning messages:
1: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
2: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
3: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
4: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
> capt <- "Estimated relationship between civilian race and probability of fatality conditional upon being involved in an officer-involved shooting. Cells show logistic coefficients with clustered-robust standard errors. Omitted category is white civilians, Charlotte and the year 2010."
> # save table
> texreg(list(glm_main1,glm_main2,glm_main3,glm_main4),
+        custom.coef.map = coefsnames,
+        omit.coef = ":",
+        include.dev = FALSE,
+        include.loglik = FALSE,
+        include.pseudors = FALSE,
+        caption = capt,
+        booktabs = TRUE,
+        use.package=FALSE,
+        float.pos = "ht!",
+        file = here("tables","logistic-FE-models.tex"),
+        label="tab:logistic_FE")
The table was written to the file '/Users/elisha/Dropbox/current-research/Glynn - Race and Policing/Papers/Published Papers/JOP_RacialBias/tables/logistic-FE-models.tex'.

Warning messages:
1: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
2: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
3: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
4: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
> 
> 
> # Table 7 adding year fixed effects LPM model Appendix -----
> lpm_main1 <- feols(fatal~Black + Hispanic + Asian +trauma10 +
+                      city_clean, 
+                    data=orig,
+                    se="cluster",
+                    cluster=cluster_variable)
NOTE: 24 observations removed because of NA values (RHS: 24).
> 
> lpm_main2 <- feols(fatal~Black + Hispanic + Asian +trauma10 +
+                      year_factor, 
+                    data=orig,
+                    se="cluster",
+                    cluster=cluster_variable)
NOTE: 24 observations removed because of NA values (RHS: 24).
> 
> lpm_main3 <- feols(fatal~Black + Hispanic + Asian + trauma10 +
+                      city_clean + year_factor,
+                    data=orig,
+                    se="cluster",
+                    cluster=cluster_variable)
NOTE: 24 observations removed because of NA values (RHS: 24).
> 
> 
> lpm_main4 <- feols(fatal~Black + Hispanic + Asian + trauma10 +
+                      city_clean*year_factor,
+                    data=orig,
+                    se="cluster",
+                    cluster=cluster_variable)
NOTE: 24 observations removed because of NA values (RHS: 24).
Variables 'city_cleanSeattle:year_factor2016', 'city_cleanKing County:year_factor2017' and 'city_cleanSan Jose:year_factor2017' have been removed because of collinearity (see $collin.var).
> capt <- "Estimated relationship between civilian race and probability of fatality conditional upon being involved in an officer-involved shooting. Cells show linear probability model coefficients with clustered-robust standard errors. Omitted category is white civilians, Charlotte and the year 2010."
> screenreg(list(lpm_main1,lpm_main2,lpm_main3,lpm_main4),
+           omit.coef = "city|year")

============================================================
                Model 1    Model 2      Model 3    Model 4  
------------------------------------------------------------
(Intercept)        0.29 *     0.43 ***     0.23      -0.06 *
                  (0.12)     (0.10)       (0.13)     (0.02) 
Black             -0.15 *    -0.19 **     -0.17 *    -0.16 *
                  (0.07)     (0.07)       (0.07)     (0.07) 
Hispanic           0.03       0.07         0.03       0.03  
                  (0.07)     (0.07)       (0.07)     (0.07) 
Asian              0.19       0.24         0.20       0.18  
                  (0.11)     (0.13)       (0.11)     (0.13) 
trauma10           0.09 *     0.05         0.10 *     0.10 *
                  (0.04)     (0.04)       (0.04)     (0.04) 
------------------------------------------------------------
R^2                0.13       0.07         0.14       0.19  
Adj. R^2           0.12       0.06         0.12       0.15  
Sigma              0.47       0.48         0.47       0.46  
nobs            1250       1250         1250       1250     
AIC             1665.53    1744.71      1669.11    1670.96  
BIC             1727.10    1806.28      1766.60    1983.94  
Log Likelihood  -820.76    -860.35      -815.56    -774.48  
============================================================
*** p < 0.001; ** p < 0.01; * p < 0.05
Warning messages:
1: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: pseudo.r.squared
2: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: pseudo.r.squared
3: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: pseudo.r.squared
4: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: pseudo.r.squared
> # save table
> texreg(list(lpm_main1,lpm_main2,lpm_main3,lpm_main4),
+        custom.coef.map = coefsnames,
+        omit.coef = ":",
+        include.dev = FALSE,
+        include.loglik = FALSE,
+        include.pseudors = FALSE,
+        include.rs = FALSE,
+        include.adjrs = FALSE,
+        caption = capt,
+        booktabs = TRUE,
+        use.package=FALSE,
+        float.pos = "ht!",
+        file = here("tables","lpm-FE-models.tex"),
+        label="tab:lpm_FE")
The table was written to the file '/Users/elisha/Dropbox/current-research/Glynn - Race and Policing/Papers/Published Papers/JOP_RacialBias/tables/lpm-FE-models.tex'.

Warning messages:
1: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: pseudo.r.squared
2: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: pseudo.r.squared
3: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: pseudo.r.squared
4: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: pseudo.r.squared
> 
> 
> # Table 8 adding year fixed effects poisson appendix ------
> pois_main1 <- fepois(fatal~Black + Hispanic + Asian +trauma10 +
+                        city_clean, 
+                      data=orig,
+                      se="cluster",
+                      cluster=cluster_variable)
NOTE: 24 observations removed because of NA values (RHS: 24).
> 
> pois_main2 <- fepois(fatal~Black + Hispanic + Asian +trauma10 +
+                        year_factor, 
+                      data=orig,
+                      se="cluster",
+                      cluster=cluster_variable)
NOTE: 24 observations removed because of NA values (RHS: 24).
> 
> pois_main3 <- fepois(fatal~Black + Hispanic + Asian + trauma10 +
+                        city_clean + year_factor,
+                      data=orig,
+                      se="cluster",
+                      cluster=cluster_variable)
NOTE: 24 observations removed because of NA values (RHS: 24).
> 
> 
> pois_main4 <- fepois(fatal~Black + Hispanic + Asian + trauma10 +
+                        city_clean*year_factor,
+                      data=orig,
+                      se="cluster",
+                      cluster=cluster_variable)
NOTE: 24 observations removed because of NA values (RHS: 24).
Variables 'city_cleanSeattle:year_factor2016', 'city_cleanKing County:year_factor2017' and 'city_cleanSan Jose:year_factor2017' have been removed because of collinearity (see $collin.var).
> capt <- "Estimated relationship between civilian race and probability of fatality conditional upon being involved in an officer-involved shooting. Cells show Poisson coefficients with clustered-robust standard errors. Omitted category is white civilians, Charlotte and the year 2010."
> screenreg(list(pois_main1,pois_main2,pois_main3,pois_main4),
+           omit.coef=c("city|year"))

===================================================================
                  Model 1     Model 2       Model 3     Model 4    
-------------------------------------------------------------------
(Intercept)         -1.34 **     -0.85 ***    -1.46 **   -16.42 ***
                    (0.45)       (0.21)       (0.46)      (0.04)   
Black               -0.35 *      -0.46 **     -0.39 *     -0.37 *  
                    (0.17)       (0.17)       (0.17)      (0.17)   
Hispanic             0.05         0.12         0.04        0.04    
                    (0.13)       (0.14)       (0.14)      (0.14)   
Asian                0.30         0.40 *       0.31        0.27    
                    (0.16)       (0.20)       (0.18)      (0.20)   
trauma10             0.18 **      0.09         0.19 **     0.21 *  
                    (0.06)       (0.09)       (0.07)      (0.09)   
-------------------------------------------------------------------
pseudo.r.squared     0.04         0.02         0.05        0.07    
nobs              1250         1250         1250        1250       
AIC               2018.26      2060.79      2027.46     2065.62    
BIC               2079.84      2122.36      2124.95     2378.60    
Log Likelihood    -997.13     -1018.39      -994.73     -971.81    
===================================================================
*** p < 0.001; ** p < 0.01; * p < 0.05
Warning messages:
1: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
2: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
3: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
4: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
> # save table
> texreg(list(pois_main1,pois_main2,pois_main3,pois_main4),
+        custom.coef.map = coefsnames,
+        omit.coef = ":",
+        include.dev = FALSE,
+        include.loglik = FALSE,
+        include.pseudors = FALSE,
+        caption = capt,
+        booktabs = TRUE,
+        use.package=FALSE,
+        float.pos = "ht!",
+        file = here("tables","poisson-FE-models.tex"),
+        label="tab:poisson_FE")
The table was written to the file '/Users/elisha/Dropbox/current-research/Glynn - Race and Policing/Papers/Published Papers/JOP_RacialBias/tables/poisson-FE-models.tex'.

Warning messages:
1: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
2: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
3: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
4: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
> 
> # Table 11 Poisson appendix ------
> # estimate subset models
> 
> glm_bl_wh <- fepois(fatal ~ White + trauma10  + 
+                       i(city_clean, ref="Charlotte"),
+                     data = orig_bl_wh,
+                     se = "cluster",
+                     cluster = cluster_variable)
NOTE: 20 observations removed because of NA values (RHS: 20).
> glm_hisp_wh <- fepois(fatal ~ White + trauma10  + 
+                         i(city_clean, ref="Charlotte"),
+                       data = orig_hisp_wh,
+                       se = "cluster",
+                       cluster = cluster_variable)
NOTE: 10 observations removed because of NA values (RHS: 10).
> glm_asian_wh <- fepois(fatal ~ White + trauma10  + 
+                          i(city_clean, ref="Charlotte"),
+                        data = orig_asian_wh,
+                        se = "cluster",
+                        cluster = cluster_variable)
NOTE: 6 observations removed because of NA values (RHS: 6).
> # save output to table 
> mynames <- list('White' = 'White',
+                 'Black' = 'Black',
+                 "Hispanic" = 'Hispanic',
+                 'Asian' = 'Asian',
+                 "city_clean::Houston" = "Houston",
+                 "city_clean::King County" = "King County",
+                 "city_clean::Los Angeles" = "Los Angeles",
+                 "city_clean::Orlando" = "Orlando",
+                 "city_clean::San Jose" = "San Jose",
+                 "city_clean::Seattle" = "Seattle",
+                 "city_clean::Tucson" = "Tucson",
+                 'trauma10' = 'Closest Trauma (10s miles)',
+                 '(Intercept)' = "Intercept")
> 
> 
> screenreg(list(glm_bl_wh, glm_hisp_wh,glm_asian_wh),
+           custom.coef.map = mynames,
+           custom.model.names = c("Black/White","White/Hispanic",
+                                  "White/Asian"),
+           include.pseudors = FALSE,
+           include.aic = TRUE)

====================================================================
                            Black/White  White/Hispanic  White/Asian
--------------------------------------------------------------------
White                          0.37 *      -0.08           -0.26    
                              (0.18)       (0.13)          (0.18)   
Houston                       -0.04         0.33            0.11    
                              (0.48)       (0.94)          (1.06)   
King County                    0.10         0.72            0.63    
                              (0.58)       (0.98)          (1.05)   
Los Angeles                    0.71         1.12            1.04    
                              (0.46)       (0.92)          (0.99)   
Orlando                        0.31         0.14            0.04    
                              (0.51)       (1.08)          (1.13)   
San Jose                       0.27         0.73            0.73    
                              (0.55)       (0.94)          (1.04)   
Seattle                        0.72         1.44            1.35    
                              (0.51)       (0.93)          (0.99)   
Tucson                         0.65         1.50            1.34    
                              (0.48)       (0.92)          (0.99)   
Closest Trauma (10s miles)     0.16         0.27 *          0.28    
                              (0.08)       (0.11)          (0.21)   
Intercept                     -1.65 ***    -1.79           -1.51    
                              (0.44)       (0.92)          (0.99)   
--------------------------------------------------------------------
pseudo.r.squared               0.03         0.03            0.05    
nobs                         715          732             279       
AIC                         1072.59      1272.88          482.07    
BIC                         1118.31      1318.84          518.38    
Log Likelihood              -526.30      -626.44         -231.03    
====================================================================
*** p < 0.001; ** p < 0.01; * p < 0.05
Warning messages:
1: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
2: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
3: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
> 
> capt <- "Poisson model regression results. Each model is run on a subset of the data to make either a Black/White, Hispanic/White or Asian/White comparison. Cluster-robust standard errors clustered on city. See \\citet{zou2004modified} for a discussion of the robust standard error correction when Poisson models are used to calculate relative risks."
> texreg(list(glm_bl_wh, glm_hisp_wh,glm_asian_wh),
+        file = here('tables','regresssion_all_race_glm.tex'),
+        custom.coef.map = mynames,
+        custom.model.names = c("Black/White","White/Hispanic",
+                               "White/Asian"),
+        label = "table:regression_all_comparisons_glm",
+        booktabs = TRUE,
+        caption = capt,
+        use.package=FALSE,
+        float.pos = "ht!",
+        include.aic = TRUE,
+        include.bic = FALSE,
+        include.loglik = FALSE,
+        include.adjrs = FALSE,
+        include.rs = FALSE,
+        include.deviance = FALSE,
+        include.nobs = TRUE,
+        include.pseudors = FALSE)
The table was written to the file '/Users/elisha/Dropbox/current-research/Glynn - Race and Policing/Papers/Published Papers/JOP_RacialBias/tables/regresssion_all_race_glm.tex'.

Warning messages:
1: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
2: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
3: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
> #custom.gof.names = c("AIC","N"),
> #reorder.gof = c(2,1))
> 
> # Relative risk on white coefficient ----
> exp(0.37)
[1] 1.447735
> 
> # Table 12 Appendix LPM -------
> lpm_bl_wh <- feols(fatal ~ White + trauma10  + 
+                      i(city_clean, ref="Charlotte"),
+                    data = orig_bl_wh,
+                    se = "cluster",
+                    cluster = cluster_variable)
NOTE: 20 observations removed because of NA values (RHS: 20).
> lpm_hisp_wh <- feols(fatal ~ White + trauma10  + 
+                        i(city_clean, ref="Charlotte"),
+                      data = orig_hisp_wh,
+                      se = "cluster",
+                      cluster = cluster_variable)
NOTE: 10 observations removed because of NA values (RHS: 10).
> lpm_asian_wh <- feols(fatal ~ White + trauma10  + 
+                         i(city_clean, ref="Charlotte"),
+                       data = orig_asian_wh,
+                       se = "cluster",
+                       cluster = cluster_variable)
NOTE: 6 observations removed because of NA values (RHS: 6).
> 
> 
> rmse1 <- fitstat(lpm_bl_wh, type = "rmse")$rmse
> rmse2 <- fitstat(lpm_hisp_wh, type = "rmse")$rmse
> rmse3 <- fitstat(lpm_asian_wh, type = "rmse")$rmse
> capt <- "Linear probability model regression results. Each model is run on a subset of the data to make either a Black/White, Hispanic/White or Asian/White comparison. Cluster-robust standard errors clustered on city."
> 
> screenreg(list(lpm_bl_wh, lpm_hisp_wh,lpm_asian_wh))

===========================================================
                         Model 1    Model 2      Model 3   
-----------------------------------------------------------
(Intercept)                 0.15       0.13         0.28   
                           (0.11)     (0.18)       (0.23)  
White                       0.16 *    -0.04        -0.16   
                           (0.08)     (0.07)       (0.12)  
trauma10                    0.07       0.15 *       0.14   
                           (0.05)     (0.07)       (0.11)  
city_clean::Houston        -0.02       0.04         0.01   
                           (0.12)     (0.17)       (0.21)  
city_clean::King County    -0.01       0.17         0.16   
                           (0.17)     (0.23)       (0.26)  
city_clean::Los Angeles     0.24       0.39 *       0.37   
                           (0.12)     (0.17)       (0.21)  
city_clean::Orlando         0.09       0.05         0.02   
                           (0.13)     (0.19)       (0.22)  
city_clean::San Jose        0.06       0.20         0.21   
                           (0.16)     (0.18)       (0.24)  
city_clean::Seattle         0.25       0.57 **      0.58 **
                           (0.17)     (0.20)       (0.22)  
city_clean::Tucson          0.22       0.63 ***     0.55 * 
                           (0.14)     (0.18)       (0.21)  
-----------------------------------------------------------
R^2                         0.09       0.12         0.19   
Adj. R^2                    0.07       0.11         0.16   
Sigma                       0.47       0.47         0.46   
nobs                      715        732          279      
AIC                       961.82     976.79       365.17   
BIC                      1007.55    1022.75       401.49   
Log Likelihood           -470.91    -478.40      -172.59   
===========================================================
*** p < 0.001; ** p < 0.01; * p < 0.05
Warning messages:
1: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: pseudo.r.squared
2: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: pseudo.r.squared
3: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: pseudo.r.squared
> 
> texreg(list(lpm_bl_wh, lpm_hisp_wh,lpm_asian_wh),
+        file = 'tables/regresssion_all_race_lm.tex',
+        custom.coef.map = mynames,
+        custom.model.names = c("Black/White","White/Hispanic",
+                               "White/Asian"),
+        label = "table:regression_all_comparisons_lm",
+        booktabs = TRUE,
+        caption = capt,
+        use.package=FALSE,
+        float.pos = "ht!",
+        include.nobs = TRUE,
+        custom.gof.rows = list("RMSE" = c(rmse1,rmse2,rmse3)),
+        include.rs = FALSE,
+        include.adjrs = FALSE)
The table was written to the file 'tables/regresssion_all_race_lm.tex'.

Warning messages:
1: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: pseudo.r.squared
2: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: pseudo.r.squared
3: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: pseudo.r.squared
> 
> # Table 13 Appendix Logistic -----
> logit_bl_wh <- feglm(fatal ~ White + trauma10  + 
+                        i(city_clean, ref="Charlotte"),
+                      data = orig_bl_wh,
+                      se = "cluster",
+                      cluster = cluster_variable,
+                      family = binomial(link = "logit"))
NOTE: 20 observations removed because of NA values (RHS: 20).
> logit_hisp_wh <- feglm(fatal ~ White + trauma10  + 
+                          i(city_clean, ref="Charlotte"),
+                        data = orig_hisp_wh,
+                        se = "cluster",
+                        cluster = cluster_variable,
+                        family = binomial(link = "logit"))
NOTE: 10 observations removed because of NA values (RHS: 10).
> logit_asian_wh <- feglm(fatal ~ White + trauma10  + 
+                           i(city_clean, ref="Charlotte"),
+                         data = orig_asian_wh,
+                         se = "cluster",
+                         cluster = cluster_variable,
+                         family = binomial(link = "logit"))
NOTE: 6 observations removed because of NA values (RHS: 6).
> 
> capt <- "Logistic model regression results. Each model is run on a subset of the data to make either a Black/White, Hispanic/White or Asian/White comparison. Cluster-robust standard errors clustered on city."
> 
> screenreg(list(logit_bl_wh, logit_hisp_wh, logit_asian_wh))

========================================================
                         Model 1    Model 2    Model 3  
--------------------------------------------------------
(Intercept)                -1.57 *    -1.73      -0.97  
                           (0.62)     (1.14)     (1.37) 
White                       0.70 *    -0.20      -0.80  
                           (0.33)     (0.33)     (0.63) 
trauma10                    0.31       0.70 *     0.66  
                           (0.22)     (0.32)     (0.54) 
city_clean::Houston        -0.08       0.28       0.05  
                           (0.67)     (1.15)     (1.31) 
city_clean::King County     0.00       0.83       0.70  
                           (0.86)     (1.31)     (1.45) 
city_clean::Los Angeles     1.12       1.78       1.66  
                           (0.65)     (1.12)     (1.26) 
city_clean::Orlando         0.47       0.23       0.08  
                           (0.72)     (1.31)     (1.40) 
city_clean::San Jose        0.33       1.00       1.04  
                           (0.81)     (1.16)     (1.35) 
city_clean::Seattle         1.15       2.62 *     2.66 *
                           (0.81)     (1.26)     (1.34) 
city_clean::Tucson          1.02       2.96 *     2.50  
                           (0.71)     (1.18)     (1.31) 
--------------------------------------------------------
pseudo.r.squared            0.07       0.09       0.14  
nobs                      715        732        279     
AIC                       916.32     931.29     349.27  
BIC                       962.04     977.25     385.58  
Log Likelihood           -448.16    -455.65    -164.63  
========================================================
*** p < 0.001; ** p < 0.01; * p < 0.05
Warning messages:
1: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
2: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
3: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
> texreg(list(logit_bl_wh, logit_hisp_wh, logit_asian_wh),
+        file = here('tables','regresssion_all_race_logit.tex'),
+        custom.coef.map = mynames,
+        custom.model.names = c("Black/White","White/Hispanic",
+                               "White/Asian"),
+        label = "table:regression_all_comparisons_logit",
+        booktabs = TRUE,
+        caption = capt,
+        use.package=FALSE,
+        float.pos = "ht!",
+        include.nobs = TRUE,
+        #custom.gof.rows = list("RMSE" = c(rmse1,rmse2,rmse3)),
+        include.rs = FALSE,
+        include.adjrs = FALSE,
+        include.pseudors = FALSE)
The table was written to the file '/Users/elisha/Dropbox/current-research/Glynn - Race and Policing/Papers/Published Papers/JOP_RacialBias/tables/regresssion_all_race_logit.tex'.

Warning messages:
1: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
2: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
3: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Adj. R$^2$texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: Sigma
> 
> 
> # Appendix page 13 -------
> # RR from logistic model 
> logit_bl_wh <- glm(fatal ~ White + trauma10  + 
+                      Houston + King_County + Los_Angeles + Orlando
+                    + San_Jose + Seattle  + Tucson,
+                    data = orig_bl_wh,
+                    family = binomial(link = "logit"))
> temp_W <- temp_B <- orig_bl_wh
> temp_W$White <- 1
> temp_B$White <- 0
> coef(logit_bl_wh)["White"] #0.70
    White 
0.6984314 
> # just use base glm because fixest object not working with predict
> RR_W <- mean(predict.glm(logit_bl_wh, newdata = temp_W, type = 'response'),na.rm=T)
> RR_B <- mean(predict.glm(logit_bl_wh, newdata = temp_B, type = 'response'),na.rm=T)
> (RR <- RR_W/RR_B)
[1] 1.462292
> round(RR,2)
[1] 1.46
> 1 - (1/RR) # 1.46
[1] 0.3161421
> 
> # linear model
> coef_W <- coefficients(lpm_bl_wh)["White"]
> temp <- orig_bl_wh %>% filter(!is.na(trauma10))
> mean_B <- tapply(temp$fatal,temp$White,mean)["0"]
> 
> round(coef_W / (coef_W + mean_B),2)
White 
 0.32 
> table(temp$White)["0"]*0.31 #148
     0 
147.87 
> 
> orig$year_factor <- factor(orig$year)
> 
> 
> temp <- orig %>% filter(!is.na(trauma10))
> dim(temp)
[1] 1250   22
> length(unique(temp$new_group_id))
[1] 729
> length(unique(orig$new_group_id)) # unique incidents
[1] 748
> table(orig$fatal)

  0   1 
666 608 
> 608/(666+608)
[1] 0.477237
> table(orig$city_clean)

  Charlotte     Houston King County Los Angeles     Orlando    San Jose 
         40         256          31         663          81          43 
    Seattle      Tucson 
         81          79 
> 
> # Table 5 Appendix --------
> load(here("data","sqf.RData"))
> dc <- read_csv(here('data','DC_stop_data.csv'))
Rows: 11638 Columns: 52
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (41): ccn_anonymized, stop_type, stop_date, stop_time, stop_location_blo...
dbl (11): observation, person_search_or_protective_pat_down, property_search...

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
> 
> #format NYC SQF race variable
> sqf$clean.race <- ifelse(sqf$race=='B', "Black",
+                          ifelse(sqf$race=='P', 'Black-Hispanic',
+                                 ifelse(sqf$race=='Q', 'White-Hispanic',
+                                        ifelse(sqf$race=='A', 'Asian',
+                                               ifelse(sqf$race=='I', 'Native American',
+                                                      ifelse(sqf$race=='X', 'Unknown',
+                                                             ifelse(sqf$race=='W', 'White',
+                                                                    ifelse(sqf$race=='Z', 'Other', NA))))))))
> 
> ## NYC model with month, year, and precinct FEs
> sqf$clean.race <- factor(sqf$clean.race,
+                          levels = c('White',
+                                     'Black',
+                                     'Black-Hispanic',
+                                     'White-Hispanic',
+                                     'Asian',
+                                     'Native American',
+                                     'other',
+                                     'Unknown'))
> summary(felm(any.force~as.factor(clean.race)|month(datestop)+year(datestop)+pct, data=sqf))

Call:
   felm(formula = any.force ~ as.factor(clean.race) | month(datestop) +      year(datestop) + pct, data = sqf) 

Residuals:
     Min       1Q   Median       3Q      Max 
-0.62931 -0.24696 -0.17514 -0.07993  1.01031 

Coefficients:
                                       Estimate Std. Error t value Pr(>|t|)    
as.factor(clean.race)Black            0.0370487  0.0007244  51.147  < 2e-16 ***
as.factor(clean.race)Black-Hispanic   0.0404049  0.0009985  40.464  < 2e-16 ***
as.factor(clean.race)White-Hispanic   0.0228245  0.0007493  30.462  < 2e-16 ***
as.factor(clean.race)Asian           -0.0076465  0.0012440  -6.147 7.91e-10 ***
as.factor(clean.race)Native American  0.0036080  0.0029665   1.216    0.224    
as.factor(clean.race)Unknown         -0.0592029  0.0089296  -6.630 3.36e-11 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.4088 on 4835580 degrees of freedom
  (217055 observations deleted due to missingness)
Multiple R-squared(full model): 0.0474   Adjusted R-squared: 0.04738 
Multiple R-squared(proj model): 0.0008529   Adjusted R-squared: 0.0008308 
F-statistic(full model): 2249 on 107 and 4835580 DF, p-value: < 2.2e-16 
F-statistic(proj model):   688 on 6 and 4835580 DF, p-value: < 2.2e-16 
*** Standard errors may be too high due to more than 2 groups and exactDOF=FALSE


> 
> ## DC model ith date and district FEs
> dc$race_ethnicity <- factor(dc$race_ethnicity,
+                               levels = c('White',
+                                          'Black',
+                                          'Hispanic',
+                                          'Asian',
+                                          'Multiple',
+                                          'Other',
+                                          'Unknown'))
> summary(felm(person_search_or_protective_pat_down~as.factor(race_ethnicity)|stop_date+stop_district, data=dc))

Call:
   felm(formula = person_search_or_protective_pat_down ~ as.factor(race_ethnicity) |      stop_date + stop_district, data = dc) 

Residuals:
     Min       1Q   Median       3Q      Max 
-0.38433 -0.15884 -0.10031 -0.01587  1.02776 

Coefficients:
                                   Estimate Std. Error t value Pr(>|t|)    
as.factor(race_ethnicity)Black     0.087396   0.009236   9.463   <2e-16 ***
as.factor(race_ethnicity)Hispanic  0.009358   0.013761   0.680    0.496    
as.factor(race_ethnicity)Asian    -0.002144   0.022267  -0.096    0.923    
as.factor(race_ethnicity)Multiple -0.012075   0.047601  -0.254    0.800    
as.factor(race_ethnicity)Other    -0.023586   0.144035  -0.164    0.870    
as.factor(race_ethnicity)Unknown  -0.010664   0.016486  -0.647    0.518    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.3212 on 11488 degrees of freedom
  (108 observations deleted due to missingness)
Multiple R-squared(full model): 0.0761   Adjusted R-squared: 0.0728 
Multiple R-squared(proj model): 0.01237   Adjusted R-squared: 0.008843 
F-statistic(full model):23.08 on 41 and 11488 DF, p-value: < 2.2e-16 
F-statistic(proj model): 23.98 on 6 and 11488 DF, p-value: < 2.2e-16 


> 
> proc.time()
   user  system elapsed 
 51.145   2.656  46.876 
